package com.ultra.db;

import java.io.File;

import com.ultra.config.AppConfig;
import com.ultra.util.FileUtil;
import com.ultra.util.SymbolUtil;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {

	private static final String DB_NAME = "ultra.db";
	private static final String DB_URL = "ultraDB";
	public DBHelper(Context context) {
		super(context, DB_NAME, null, 2);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		System.out.println("===============DBHelper.onCreate 开始");
		File file = new File(FileUtil.getSdcardPath() + SymbolUtil.SEPARATOR + AppConfig.IMG_PATH + DB_URL + SymbolUtil.SEPARATOR + DB_NAME);
		File f = new File("/data/data/com.ultra/databases");
		f.mkdir();
		f.compareTo(file);
		System.out.println("===============DBHelper.onCreate 结束");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		System.out.println("===============DBHelper.onUpgrade 开始");
		//db.execSQL("CREATE TABLE tb_cache_base2 (_id INTEGER PRIMARY KEY AUTOINCREMENT)");
		System.out.println("===============DBHelper.onUpgrade 结束");
	}

}
